<template>
    <div class="gold-shop-wrap">
        <van-nav-bar title="审核通知" left-arrow fixed @click-left="onClickLeft" />
        <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
            <div class="notify_list" v-for="(item, index) in notifyList" :key="index">
                <div class="notify_time">{{ item.create_time }}</div>
                <div class="notify_item">
                    <div class="notify_title">审核通知</div>
                    <div class="notify_content">{{ item.content }}</div>
                    <!-- <div class="notify_icon">》</div> -->
                </div>
            </div>
        </van-list>

    </div>
</template>
<script>
import {SHOP_AUDIT_logs} from '@/api/mine'
export default({
  data() {
      return {
        loading:false,
        finished:false,
        notifyList:[],
        page:1,
        pageSize:20,
      }
  },
  mounted() {
    window.scrollTo(0, 0)

  },
  methods: {
      onClickLeft() {
          this.$router.back()
      },
      onLoad() {
                 let params = {};
				params['page_num'] = this.page;
				params['page_size'] = this.pageSize;
				params['shop_id'] = this.$route.query.shop_id;
                this.$http.get(SHOP_AUDIT_logs, {params:params})
				.then(res => {
				  const {
				    list
				  } = res.data;
				  if(list && list.length) {
				     this.page++;
				     this.notifyList = this.notifyList.concat(list);

				     // 加载状态结束
				     this.loading = false;
				     if(list.length < this.pageSize) {
				      this.finished = true;
				     }
				  }else {
				    this.finished = true;
				  }
				})
    },
  },
})
</script>
<style scoped lang="scss">
.gold-shop-wrap {
    min-height: calc(100vh - 46px);
    padding-top: 46px;
    background: #F2F4F5;

    ::v-deep .van-nav-bar .van-icon {
        color: #333333;
    }

    ::v-deep .van-nav-bar__arrow {
        font-size: 20px;
    }

    ::v-deep .van-nav-bar__text {
        color: #333;
    }
}

.notify_list {
    // width: 95%;
    margin: 0 auto;
    margin-bottom: 0.2rem;
    // padding-bottom: 0.32rem;

    // background: #fff;
    .notify_time {
        font-family: PingFangSC, PingFang SC;
        font-weight: 400;
        font-size: .24rem;
        color: #C3C3C3;
        // line-height: 17px;
        text-align: center;
        font-style: normal;
        padding-top: 0.28rem;
    }

    .notify_item {
        width: 95%;
        margin: 0 auto;
        margin-top: 0.32rem;
        // border: 1px solid #999;
        background: #ffff;
        border-radius: 0.24rem;
        padding: 0.28rem;
        box-sizing: border-box;

        .notify_title {
            font-size: 0.28rem;
            font-weight: bold;
            color: #333333;
        }

        .notify_content {
            font-size: 0.24rem;
            color: #666666;
            margin-top: 0.2rem;
        }

        .notify_icon {
            float: right;
            font-size: 0.24rem;
            color: #999999;
            margin-top: -0.3rem;
        }
    }
}
</style>
